package com.ibeeking.gmc.global.g.rest.controller.v1.feign;

import com.ibeeking.gmc.global.api.common.dto.CampaignSceneDTO;
import com.ibeeking.gmc.global.g.rest.service.ICampaignSceneService;
import com.ibeeking.gmc.global.g.rest.service.ICampaignSceneTenantService;
import com.ibeeking.gmc.global.service.common.query.CampaignSceneQuery;
import com.ibeeking.nematos.constants.enums.OperateLogTypeEnum;
import com.ibeeking.nematos.log.annotation.Log;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName CampaignSceneController控制器
 * @Description 活动场景
 * @Author ibeeking
 * @Date 2020-12-01 18:15
 **/
@RestController
@RequestMapping("/b/campaignSceneTenant/feign/v1")
public class CampaignSceneFeignController {

    @Resource
    private ICampaignSceneTenantService campaignSceneTenantServiceImpl;
    @Resource
    private ICampaignSceneService campaignSceneServiceImpl;

    @Log(logType = OperateLogTypeEnum.QUERY, describe = "查询活动场景")
    @PostMapping(value = "/queryCampaignScene")
    public List<CampaignSceneDTO> queryCampaignScene(@RequestBody CampaignSceneQuery query) {
        return campaignSceneTenantServiceImpl.queryCampaignScene(query);
    }

    @Log(logType = OperateLogTypeEnum.QUERY, describe = "查询活动场景")
    @PostMapping(value = "/queryCampaignSceneByCode")
    public List<CampaignSceneDTO> queryCampaignSceneByCode(@RequestBody List<String> codes) {
        return campaignSceneServiceImpl.queryCampaignSceneByCode(codes);
    }
}
